package com.dyna.foundation.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.dyna.constants.DateFatter;
import com.dyna.domain.dto.TenantBase;
import com.dyna.enums.RoleTypeEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
/**
 * @description sys_role
 * @author admin
 * @date 2024-08-12
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
@ApiModel("sys_role")
public class SysRole extends TenantBase implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("角色名称")
    private String name;


    @ApiModelProperty("角色编码")
    private String code;


    @ApiModelProperty("显示顺序")
    private Integer sort;

    /**
     * 角色类型
     *
     * 枚举 {@link RoleTypeEnum}
     */
    private Integer type;


    @ApiModelProperty("角色状态(1-正常；0-停用)")
    private Integer status;


    @ApiModelProperty("逻辑删除标识(0-未删除；2-已删除)")
    private Integer delFlag;


    @ApiModelProperty("数据权限(0-所有数据；1-部门及子部门数据；2-本部门数据；3-本人数据)")
    private Integer dataScope;


    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = DateFatter.YYYY_MM_DD_HH_MM_SS)
    private LocalDateTime createTime;


    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = DateFatter.YYYY_MM_DD_HH_MM_SS)
    private LocalDateTime updateTime;

    public SysRole() {}
}